#ifndef RemoteTest_H
#define RemoteTest_H

#include <QObject>
#include <QRemoteObject2.h>
#include <QPointer>
#include <QRemoteItem.h>

class SubObjectTest;

class RemoteTest:public QRemoteItem{
    Q_OBJECT
    Q_CLASS_NAME(RemoteTest)


    REMOTE_PROPERTY(name,REMOTE_PROP_FLAG_READWRITE)
    Q_BINDABLE_PROPERTY_AUTO(QString,name)

    Q_BINDABLE_PROPERTY_AUTO(SubObjectTest*,sub)

    REMOTE_PROPERTY(self,REMOTE_PROP_FLAG_READWRITE)
    Q_BINDABLE_PROPERTY_AUTO(RemoteTest*,self)
public:
    RemoteTest(QRemoteItem* parent = NULL);

    REMOTE_SIGNAL(testSignal,REMOTE_PROP_FLAG_BROAD_CAST,int,double)
    REMOTE_SIGNAL(refSignal,REMOTE_PROP_FLAG_BROAD_CAST,QPointer<RemoteTest>)



    REMOTE_SLOT(testSlot,int,REMOTE_PROP_FLAG_SERVER_ONLY,int);


    REMOTE_SIGNAL(ownerSignal,REMOTE_PROP_FLAG_OWNER_ONLY,int);
    REMOTE_SLOT(ownerSlot,int,REMOTE_PROP_FLAG_OWNER_ONLY,int);
};

class SubObjectTest:public QRemoteItem{
    Q_OBJECT
    Q_CLASS_NAME(SubObjectTest)


    REMOTE_PROPERTY(number,REMOTE_PROP_FLAG_READWRITE)
    Q_BINDABLE_PROPERTY_AUTO(QString,number)
public:
    SubObjectTest(QRemoteItem* parent = NULL);

    REMOTE_SIGNAL(testSignal,REMOTE_PROP_FLAG_BROAD_CAST,int,double)
};


#endif
